# 测试集留下100张
import shutil
import os
def move_100(path_train='./classification_24category/train'
        ,path_test='./classification_24category/test'):
        # 文件夹list，24种染色体图片
    path_dir_name_s = list(range(1,23)) +['X','Y'] # 24种染色体的文件夹名
    for i,path_name_dir in enumerate(path_dir_name_s):
        # 某一种染色体的文件夹
        path_dir = f'{path_test}/{path_name_dir}'
        path_list = os.listdir(path_dir)[100:]
        print(len(path_list))
        for path_img in path_list:
            # 每一张染色体图片的路径
            path_from_i = f'{path_test }/{path_name_dir}/{path_img}'
            path_to_i   = f'{path_train}/{path_name_dir}/{path_img}'
            shutil.move(path_from_i,path_to_i)